﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ITOMMS.Entity;


namespace ITOMMS.Web.InsideManage
{
    public partial class SmsSendView : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                if (Request.Params["id"] != null)
                {
                    string sid = Request.Params["id"].ToString();
                    int pid = 0;
                    if (int.TryParse(sid, out pid))
                    {
                        DataShow(pid);
                    }
                }
            }
        }

        private void DataShow(int dispatchId)
        {
            tbMobileMessageEntity entity = new tbMobileMessageEntity();
            entity = entity.FindEntity("ID=" + dispatchId);
            if (entity != null)
            {
                this.lblSendMobile.Text = entity.SendMobile;
                this.lblReceiveMobile.Text = entity.ReceiveMobile;
                this.lblSendDate.Text = entity.SendDate.ToString();
                this.lblMessageContent.Text = entity.MessageContent;
            }
        }

        protected void btnBack_ServerClick(object sender, EventArgs e)
        {
            Response.Redirect("SmsSendList.aspx", true);
        }
    }
}